[C# .NET6] AutoFac ADD implementation after DI Container Resolve


If you want to Add a implementation after DI Container resolved already,
you need to create a newBuilder and Update it to the original Container.

                var newBuilder = new ContainerBuilder();
                newBuilder.Register(c =>  new Car {Seats = GetSeats().Split(',') }).As<ICar>();
                newBuilder.Update(OriginalDIContainer);
#C# #.net6 #.net






你可能感興趣的文章

第二周筆記 (JS) -1

第二周筆記 (JS) -1

將 ChatGPT LineBot 部屬在 Google Scripts 上

將 ChatGPT LineBot 部屬在 Google Scripts 上

[Alpha Camp] 學期2-2回顧

[Alpha Camp] 學期2-2回顧






留言討論